package com.ac.app.web.action.invest;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.ac.app.dm.RecordInvest;
import com.caac.core.service.BaseManager;
import com.caac.core.web.action.BaseAction;
import com.caac.core.web.form.BaseForm;

public class DoMatchRecordAction extends BaseAction {

	@Override
	protected ActionForward doExecute(ActionMapping mapping, BaseForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		String investId=request.getParameter("investId");
        String[] ids = request.getParameterValues("id");
        BaseManager manager = this.getBaseManager();
        for (int i = 0; i < ids.length; i++) {
        	RecordInvest dm=new RecordInvest();
        	dm.setInvestId(investId);
        	dm.setRecordId(ids[i].trim());
        	manager.saveObject(dm);
        }
        return forward(mapping,new String[]{investId});
    }
	}


